package chapter6.parter5;

import java.util.Random;

public class Test {

    public static void main(String[] args) {
        for(int i=0;i!=10;++i){
            System.out.print(rand10()+" ");
        }
    }

    private static int rand7(){
        Random random = new Random();

        int result=random.nextInt(7)+1;
        return result;
    }

    public static int rand10(){
        int x=0;
        do{
            x=(rand7()-1)*7+rand7();
        }while(x>40);

        int result=x%10+1;
        return result;

    }


}
